package com.javasm.pk;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "dj-pk-service", path = "/pk")
public interface PkClient {

    @GetMapping("/getId")
    long getId();

    @GetMapping("/getLongKey")
    long getLongKey(@RequestParam String type);

    /**
     * 批量获取id
     * @param type
     * @param count 获取多少个
     * @return list中有2个元素，第一个是最小值，第二个是最大值
     * 比如：count = 100 返回 1,100
     */
    @GetMapping("/getLongRange")
    List<Long> getLongRange(@RequestParam String type, @RequestParam int count);

    @GetMapping("/getSerialNumber")
    String getSerialNumber(@RequestParam String type, @RequestParam int length);

    @GetMapping("/getGradeCode")
    String getGradeCode(@RequestParam String rule, @RequestParam String parentCode,
                        @RequestParam String type);
}
